<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="http://localhost/e-shop/xiangqu/Application/Index/View/List/css/list.css"/>
		<script src="http://localhost/e-shop/xiangqu/Static/js/jquery-1.7.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var APP = "<?php echo U('Index/List/ajaxLike');?>"
		</script>
		<script src="http://localhost/e-shop/xiangqu/Application/Index/View/List/js/list.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<!--头部固定区-->
		<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!--头部固定区-->
<style type="text/css">
	#header .header_content .logined a{
		font: 400 14px/50px "微软雅黑";
	}
</style>
		<div id="header_fixed"></div>
		<div id="header">
			<div class="header_content">
				<div class="logo"><img src="http://localhost/e-shop/xiangqu/Application/Index/View/List/images/logo.png" alt="" /></div>
				<?php if(!isset($_SESSION['username'])): ?>
				<div class="login">
					<!--<a href=""><span></span></a>-->
					<a href="<?php echo U(('Index/Register/index'));?>">注册</a>
					<a href="<?php echo U(('Index/Login/index'));?>">登录</a>
				</div>
				<?php else:  ?>
				<!--已登录begin-->
				<div class="logined">
					<a href="<?php echo U('out');?>">退出</a>
					<a href="<?php echo U('Index/Orders/myOrder');?>">我的订单</a>
					<a href="<?php echo U('Index/Carts/index');?>">购物车</a>
					<a href="<?php echo U('Index/User/index');?>"><?php echo $_SESSION['nick'] ?></a>
					<a href="<?php echo U('Index/Orders/myOrder');?>" class="face"><img src="http://localhost/e-shop/xiangqu/<?php echo $face;?>" alt="" /></a>
				</div>
				<!--已登录end-->
				<?php endif  ?>
			</div>
		</div>
		<!--头部end-->
		<!--菜单栏begin-->
		<div id="nav">
			<div class="nav_content">
				<a href="<?php echo U('Index/Index/index');?>">首页</a>
				<?php foreach ($navData as $k=>$v){?>
				<a href="<?php echo U('Index/List/index',array('cid'=>$v[cid]));?>"><?php echo $v['cname'];?></a>
				<?php }?>
				<div class="search">
					<form action="<?php echo U('Index/Search/index');?>" method="get">
						<input type="text" class="text" name="keys" placeholder="搜索" />
						<input type="submit" class="sbt" value=""/>
					</form>
				</div>
			</div>
		</div>
		<!--菜单栏end-->
		<!--产品分类-逛商品begin-->
		<div id="category">
			<div class="c_title_all"><span class="s_all"></span><h2>逛商品</h2></div>
			<div class="c_content">
				<!--分类begin-->
				<?php foreach ($dataCate as $k=>$v){?>
				<div class="c_box box<?php echo $k;?> allCate">
					<dl>
						<dt>
							<a href="<?php echo U('Index/List/index',array('cid'=>$v['cid']));?>"><?php echo $v['cname'];?></a>
							<br />
							<i class="iconfont">&#xf00a9;</i>
						</dt>
						<dd>
							        <?php
        //初始化
        $hd['list']['n'] = array(
            'first' => false,
            'last'  => false,
            'total' => 0,
            'index' => 0
        );
        if (empty($v['son'])) {
            echo '';
        } else {
            $listId = 0;
            $listShowNum=0;
            $listNextId=0;
            foreach ($v['son'] as $n) {
                //开始值
                if ($listId<0) {
                    $listId++;
                    continue;
                }
                //步长
                if($listId!=$listNextId){$listId++;continue;}
                //显示条数
                if($listShowNum>=5)break;
                //第几个值
                $hd['list'][n]['index']++;
                //第1个值
                $hd['list'][n]['first']=($listId == 0);
                //最后一个值
                $hd['list'][n]['last']= (count($v['son'])-1 <= $listId);
                //总数
                $hd['list'][n]['total']++;
                //增加数
                $listId++;
                $listShowNum++;
                $listNextId+=1
                ?>
							<a href="<?php echo U('Index/List/index',array('cid'=>$n['cid']));?>"     <?php if($n['cid']==$hd['get']['cid']){ ?>class="selected"<?php } ?> ><?php echo $n['cname'];?></a>
							<?php }}?>
						</dd>
					</dl>
				</div>
				<?php }?>
				<!--艺术品begin-->
				<div class="c_box box7 art">
					<dl>
						<dt><a href="">艺术品<br/>展厅</a></dt>
						<dd>
							<a href="">即将开业</a>
						</dd>
					</dl>
				</div>
				<!--艺术品end-->
				<!--分类end-->
			</div>
		</div>
		<!--产品分类-逛商品end-->
		<!--页面主体区域begin-->
		<!--产品列表begin-->
		<div id="list">
			<div class="l_title">
				<h2>逛商品</h2>
				<?php 
					$screen = Q('get.param',0,'intval')
				 ?>
				<a href="<?php echo U('Index/List/allCate',array('order'=>0));?>"      <?php if($_GET['order']==0){ ?>class="choose"<?php } ?> >推荐</a>
				<a href="<?php echo U('Index/List/allCate',array('order'=>1));?>"      <?php if($_GET['order']==1){ ?>class="choose"<?php } ?> >最新</a>
				<a href="<?php echo U('Index/List/allCate',array('order'=>2));?>"      <?php if($_GET['order']==2){ ?>class="choose"<?php } ?> >最热</a>
				<span class="t_dot"></span>
			</div>
			<?php 
				if(!isset($listData)) echo "<div class='error'><h3>亲~~~暂无此商品/(ㄒoㄒ)/~~</h3></div>"
			 ?>
			<?php foreach ($listData as $K=>$v){?>
			<div class="product">
				<a href="<?php echo U('Index/Product/index',array('cid'=>$v['category_cid'],'gid'=>$v['gid']));?>" class="p_img"><img src="http://localhost/e-shop/xiangqu/<?php echo $v['picture'];?>"/></a>
				<div class="p_infor">
					<div class="p_price"><span class="sp">¥<?php echo $v['shopprice'];?></span><span class="dis_like"></span><span class="like" gid="<?php echo $v['gid'];?>"></span><div class="pp"><p class="count"><span class="c"><?php echo $v['like'];?></span><span class="add1">+1</span></p></div></div>
					<a href="" class="p_name"><?php echo $v['bname'];?></a>
					<a href="<?php echo U('Index/Product/index',array('cid'=>$v['category_cid'],'gid'=>$v['gid']));?>" class="tag1"><?php echo $v['gvalue']['0'];?></a><span class="dot"></span><a href="<?php echo U('Index/PUBLIC/index',array('gid'=>$v['gid']));?>" class="tag2"><?php echo $v['gvalue']['1'];?></a>
				</div>
			</div>
			<?php }?>
		</div>
		<!--产品列表end-->
		<!--页面主体区域end-->
		
		<!--页面底部begin-->
		<div id="footer">
			<div class="foot_wrap">
				<div class="say">
					<p class="p1">“如果你的东西和大家都一样，那干嘛还设计它？”</p>
					<p class="p2">by  Philippe Starck</p>
				</div>
				<div class="foot_logo"></div>
				<p class='infor'>Copyright 2015 版权所有 浙ICP备12027496 <a href="">热门精选</a> <a href="">热门分类</a></p>
				<p class='link'>商务合作  友情链接： 想去网  蘑菇街 360安全网址 爱图购</p>
			</div>
		</div>
		<!--页面底部end-->
	</body>
</html>
